<?php

class carsController {
	
	function __construct() {
	}
	
	public function index() {		
		$this->listcars();		
	}	

	public function listcars() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->listcars();
		echo json_encode( $data );
	}
	
	public function carstatus() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->carstatus();
		echo json_encode( $data );
	}
	
	public function inscar() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->inscar();
		echo json_encode( $data );
	}
	
	public function updcar() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->updcar();
		echo json_encode( $data );
	}
	
	public function delcar() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->delcar();
		echo json_encode( $data );
	}
	
	public function listserv() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->listserv();
		echo json_encode( $data );
	}
	
	public function insserv() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->insserv();
		echo json_encode( $data );
	}
	
	public function updserv() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->updserv();
		echo json_encode( $data );
	}
	
	public function delserv() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new cars;
		$data = $model->delserv();
		echo json_encode( $data );
	}
	
	public function jsload() {		
		if( !Tools::isAjax() ) return;
		App::me()->js_load('cars.js');
	}	
	
}
?>